package base.json.fastjson.demo03;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private String name;
    private Integer age;
    private BigDecimal salary;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime birth;

    public User(String name, Integer age){
        this.name = name;
        this.age = age;
    }

    public User(String name, Integer age, BigDecimal salary){
        this.name = name;
        this.age = age;
        this.salary = salary;
    }

    public User(String name, Integer age, LocalDateTime birth){
        this.name = name;
        this.age = age;
        this.birth = birth;
    }

}

